Release 10.1A: OpenEdge Data Management:
SQL Reference
DISCONNECT
Terminates the connection between an application and the database to which it is connected.
Syntax
connection_nameThe name of the connection as either a character literal or host variable.
CURRENTDisconnects the current connection.
ALLDisconnects all established connections.
DEFAULTDisconnects the connection to the default database.
ExamplesThe first example illustrates
CONNECT TO ASconnection_name andDISCONNECTconnection_name:
This example illustrates
CONNECT TO DEFAULTandDISCONNECT DEFAULT:
This example disconnects all database connections. After you issue
DISCONNECT ALLthere is no current connection:
The following example illustrates the
CONNECT,SET CONNECTION, andDISCONNECTstatements in combination using these steps:1.
CONNECT TOconnect_stringASconnection_name, which establishes a connect_string connection to the database in the connect_string; the connection has the name 'conn_1'.2.
CONNECT TO DEFAULT, which establishes a connection to theDEFAULTdatabase and sets this connection current.3.
DISCONNECT DEFAULT,which disconnects the connection to theDEFAULTdatabase.4.
SET CONNECTIONconnection_name, which sets the 'conn_1' connection current.5.
DISCONNECT CURRENT, which disconnects the 'conn_1' connection.This example illustrates connection management statements in combination:
Notes
- When you specify
DISCONNECTconnection_name orDISCONNECT CURRENTand there is also an established connection to theDEFAULTdatabase, the connection to theDEFAULTdatabase becomes the current connection. If there is noDEFAULTdatabase, there is no current connection after the SQL engine processes theDISCONNECT.- The
DISCONNECT DEFAULTstatement terminates the connection to theDEFAULTdatabase. If this connection is the current connection, there is no current connection after thisDISCONNECTstatement is executed.Authorization
None
Related statements
CONNECT, SET CONNECTION
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |